package com.gxinyu.needle

import androidx.core.os.bundleOf
import com.alibaba.android.arouter.facade.annotation.Route
import com.gxinyu.needle.constans.LOGIN_NAME
import com.gxinyu.needle.constans.LOGIN_PASSWORD
import com.gxinyu.needle.constans.RoutePath
import com.gxinyu.needle.databinding.FragmentDetailBinding
import com.gxinyu.needle.login.LoginFragment

/**
 * @author gxinyu
 * @date  2022/5/8
 * @desc 详情页
 */
@Route(path = RoutePath.LOGIN_DETAIL)
class DetailFragment : BaseFragment<Nothing, FragmentDetailBinding>() {

    override fun bindLayout(): FragmentDetailBinding {
        return FragmentDetailBinding.inflate(layoutInflater)
    }

    override fun bindListener() {
        super.bindListener()
        binding.btnBack.setOnClickListener {
            onBackPressed()
        }

        binding.btnGoLogin.setOnClickListener {
            val bundle = bundleOf(
                LOGIN_NAME to "gxinyu",
                LOGIN_PASSWORD to "123456",
            )
            replace(LoginFragment(), bundle)
        }
    }
}